﻿using System;
using System.Buffers;
using System.Net.Sockets.Kcp;

namespace Server
{
    public class KcpCallback : IKcpCallback
    {
        public Action<Memory<byte>> OnOutput;

        public IMemoryOwner<byte> RentBuffer(int lenght)
        {
            return null;
        }

        public void Output(IMemoryOwner<byte> buffer, int avalidLength)
        {
            using (buffer)
            {
                OnOutput(buffer.Memory.Slice(0, avalidLength));
            }
        }
    }
}